<table border="1" cellpadding="1" cellspacing="0">
    <tr>
        <th scope="row">ID</th>
        <th scope="row">Tên khách hàng</th>
        <th scope="row">ID đơn hàng</th>
        <th scope="row">Số tiền</th>
        <th scope="row">Ngày</th>
        <th scope="row">Xóa</th>
    </tr>
<?php
while($aRow = mysql::fetchSql($aResult)){
?>
    <tr>
        <td><a href="<?php echo func::makeUrl('payment', 'update', $aRow['paymentId']); ?>"><?php echo $aRow['paymentId']; ?></a></td>
        <td><a href="<?php echo func::makeUrl('customer', 'update', $aRow['customerId']); ?>">
            <?php
                $sSql = "SELECT name FROM customer WHERE customerId =". $aRow['customerId'];
                $aCustomer = mysql::querySql($sSql);
                $aCustomerRow = mysql::fetchSql($aCustomer);
                echo $aCustomerRow['name'];
            ?>
            </a>
        </td>
        <td><a href="<?php echo func::makeUrl('order', 'update', $aRow['orderId']); ?>"><?php echo $aRow['orderId']; ?></a></td>
        <td><?php echo func::numberFormat($aRow['amount']); ?></td>
        <td><?php echo func::getDate($aRow['date']); ?></td>
        <td><a href="<?php echo func::makeUrl('payment', 'delete', $aRow['paymentId']); ?>">Xóa</a></td>
    </tr>
<?php
}
$aResult->free();
?>
    <tr>
        <td colspan="7" align="right"><a href="<?php echo func::makeUrl('payment', 'add'); ?>">Thêm thanh toán</a></td>
    </tr>
</table>